//package com.young.springdemo.config.annotation;
//
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.*;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.stereotype.Component;
//
///**
// * @program: springdemo
// * @description 后置日志查询系统
// * @author: Young
// * @create: 2020-05-29 16:52
// **/
//@Aspect
//@Slf4j
//@Component
//public class AspectAfterLog {
//
//    @Pointcut(value = "execution(public * com.young.springdemo.controller..*.*(..))")
////    @Pointcut("@annotation(OperateLog)")
//    public void pointCut(){};
//
//    @Before("pointCut()")
//    public void logStart(JoinPoint joinPoint){
//        MethodSignature signature =  (MethodSignature)joinPoint.getSignature();
//        String method = signature.getMethod().getName();
//        log.info("方法[{}]===开始===执行了...",method);
//    }
//    @After("pointCut()")
//    public void logEnd(JoinPoint joinPoint){
//        MethodSignature signature =  (MethodSignature)joinPoint.getSignature();
//        String method = signature.getMethod().getName();
//        log.info("方法[{}]===结束===执行了...",method);
//    }
//
//    @AfterReturning(value = "pointCut()",returning = "result")
//    public void logReturn(JoinPoint joinPoint,Object result){
//        MethodSignature signature =  (MethodSignature)joinPoint.getSignature();
//        String method = signature.getMethod().getName();
//        log.info("方法[{}]===正常结束===,获取的返回值是[{}]...",method,result);
//    }
//
//    @AfterThrowing(value = "pointCut()",throwing = "e")
//    public void logThrow(JoinPoint joinPoint,Exception e){
//        MethodSignature signature =  (MethodSignature)joinPoint.getSignature();
//        String method = signature.getMethod().getName();
//        log.info("方法[{}]===异常结束===,异常信息是[{}]...",method,e.getMessage());
//    }
//
//    @Around("pointCut()")
//    public Object logArount(ProceedingJoinPoint joinPoint) throws Throwable{
//        log.info("环绕通知开始");
//        Object proceed = joinPoint.proceed();
//        log.info("环绕通知结束");
//        return proceed;
//    }
//
//
//}
